<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>账号中心</title>
    <link rel="stylesheet" href="${ctx}/static/plug/frozenui-1.3.0/css/frozen.css" media="all">
    <link rel="stylesheet" href="${ctx}/static/css/user/register.css" media="all">
    <style type="text/css">
        .text_alert {
            border-color: #FF4500 !important;
            border-style: solid !important;
            border-top-width: 0px !important;
            border-right-width: 0px !important;
            border-bottom-width: 1px !important;
            border-left-width: 0px !important;
        }

    </style>
</head>
<body ontouchstart="">
<section class="ui-container">
    <div class="ui-flex ui-flex-ver ui-flex-pack-center ui-flex-align-start">
        <div style="width:100%;padding-top:40px">
            <form id="dataForm">
                <div class="ui-flex ui-flex-ver ui-flex-pack-center ui-flex-align-start content" style="margin:0 auto;">
                    <div>
                        <p class="title" id="pTips" style="font-size: 20px">绑定慧泊客商家账号</p>
                    </div>
                    <div class="register-input">
                        <input value="" placeholder="输入商家账号"  id="entNo"/>

                    </div>
                    <div class="register-input ">
                        <input value="" placeholder="输入密码" maxlength="12" id="password"/>
                    </div>
                    <div>
                        <p class="error" id="showMsgP"></p>
                    </div>
                    <div style="padding-top: 30px;">
                        <button type="button" class="ui-btn ui-btn-primary" style="width: 100%; height: 50px"
                                id="bindShopBtn">绑定商家账号
                        </button>
                    </div>
                </div>

                <div class="ui-flex ui-flex-ver ui-flex-pack-center ui-flex-align-start content" style="margin:0 auto;">
                    <ul class="ui-list-pure" style="font-size: 18px">
                        <li class="ui-txt-info">
                            <h5>1.如何获得慧泊客商家账号?</h5>
                            <h6>停车场商家与慧泊客停车支付平台达成和签署合作协议之后，慧泊客会给停车场商家提供一个商家账号及其初始密码。</h6>
                        </li>
                        <li class="ui-txt-info">
                            <h5>2.慧泊客商家账号可以做什么？</h5>
                            <h6>停车场管理人员可以通过登录慧泊客账号实时查询停车收入流水，监控停车场运营情况</h6>
                        </li>

                    </ul>
                </div>
            </form>
        </div>
    </div>
</section>
</body>
<script src="${ctx}/static/plug/frozenui-1.3.0/lib/zepto.min.js"></script>
<script src="${ctx}/static/plug/frozenui-1.3.0/js/frozen.js"></script>
<script>

    var paramObj = {
        "bindWxParams": "${bindWxParams}",
        "enterpriseParams": "${enterpriseParams}"
    };

    var canSubmit = true;
    $(function () {
        $("#bindShopBtn").click(function () {
            if (canSubmit) {
                if (!$("#entNo").val()) {
                    showTips("warn", "请输入您的账号");
                    $("#entNo").addClass("text_alert");
                    return;
                }

                if (!$("#password").val()) {
                    showTips("warn", "请输入您的密码");
                    $("#password").addClass("text_alert");
                    return;
                }

                var paraObj = {
                    "params": paramObj.bindWxParams,
                    "entNo": $("#entNo").val(),
                    "password": $("#password").val()
                };
                canSubmit = false;
                $.post("${action}", paraObj, function (obj) {
                    if (obj.result) {
                        showTips("info", "绑定成功");
                        var hrefUrl = "${action}?params=" + paramObj.enterpriseParams;
                        window.location.href = hrefUrl;
                    } else {
                        $("#showMsgP").html(obj.msg);
                    }
                    canSubmit = true;
                });
            }
        });
    });


</script>
</html>